// Lindsay Gilmour
// Adam Lusch
// Dan Niceswanger
//
// Computer Graphics Project 1:
// Asteroids!
// A Tribute

#ifndef THING_H
#define THING_H

#include <iostream>
#include <map>
#include <GL/glut.h>

#include <Box2D.h>

using namespace std;

class Thing
{
	public:
		Thing(b2World*, int32 = 0, int32 = 0);
		virtual ~Thing();

		virtual void draw() = 0;

		void move(const b2Vec2&);
		void rotate(float32);

		const b2Vec2& getPosition() const;
		b2Vec2 getLinearVelocity() const;
		float32 getBoundingRadius() const;
		float32 getAngle() const;
		
		int32 getMagic() const;

	protected:

		void updateBoundingRadius(const b2PolygonDef&);
		
		b2Body* body;
		float32 boundingRadius;
		b2AABB tester;
		b2World* world;
		
		GLuint baseDisplayList;
		int32 numDisplayLists;
		
		const int32 magic;
};

#endif
